import { defineStore } from "pinia"
import { computed, ref } from "vue"

export const useCounterStore = defineStore("counter", () => {
  const totalCount = ref(0)

  const doubleCount = computed(() => totalCount.value * 2)

  const addCount = (num: number) => {
    totalCount.value += num
  }
  return {totalCount ,doubleCount,addCount}
},
  {persist:true}
)